﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;

namespace SynoManager
{
    public abstract class ServiceBase : IService
    {
        public event OnlineStateChangedEventHandler OnlineStateChanged;
        private bool isOnline;
        public bool IsOnline
        {
            get { return isOnline; }
            internal set
            {
                if (isOnline != value)
                {
                    if (OnlineStateChanged != null)
                        OnlineStateChanged(this, new OnlineStateChangedEventArgs());

                    isOnline = value;
                }
            }
        }

        public SynoDevice Device
        {
            get { return device; }
        }

        private SynoDevice device;
        public virtual void Initialize(SynoDevice device)
        {
            this.device = device;

        }

        public virtual void Close()
        {
            
        }
    }
}
